<?php

namespace app\admin\controller\sys;

use app\admin\controller\Base;
use app\admin\controller\Qiniu;
use think\Db;
use think\facade\Request;


/**
 * 用户组管理
 * Class GroupController
 * @package app\admin\controller\auth
 */
class Wechat extends Base
{

    public function index()
    {
//        dump(config());
//        exit;
        return view();
    }


    public function lists()
    {
        $map = array();
        $data = array();
        $post = $this->request->param();
        $data['count'] = Db::name('product_wx')
            ->where($map)
            ->count();
        $data['data'] = Db::name('product_wx')
            ->where($map)
            // ->fetchSql(true)
            ->order('id desc')->page(input("param.page"), input('param.limit'))->select();
        foreach ($data['data'] as &$item) {
            $item['update_time'] = date('Y-m-d H:i:s', $item['update_time']);
        }

        if ($data['count'] > 0 && $data['data']) {
            $data['msg'] = '获取成功';
        } else {
            $data['msg'] = '获取数据为空';
        }
        $data['code'] = 0;
        return json($data);
    }


}